home *** CD-ROM | disk | FTP | other *** search
- ///////////////////////////////////////////////
- // Real World Fractals 2
-
- #include "stdafx.h"
- #include "itriazon.h"
- #include "itriadoc.h"
- #include "itriavw.h"
- #include "external.h"
- #include "rw1.h"
- #include "rw2.h"
- #include "math.h"
- #include "convolut.h"
- #include "nthorder.h"
- #include "post.h"
- #include "orient.h"
- #include "filter12.h"
-
- ////////////////////////////////////////////////////////////
- // Real World equations start here
- ////////////////////////////////////////////////////////////
-
- void CIterationsView::RealWorld2()
- {
- switch (nDistortion)
- {
- case 16:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z*c).ccos()*c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 22:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) - (c^rm);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 23:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) + (z^rm) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 24:
- // Barnsley
- // if ((z.r * c.i + c.r * z.i) >= 0) F(z) = z*c-c; else F(z) = z*c+c;
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- if (z.real()*c.imaginary() + c.real()*z.imaginary() >= 0)
- z = z*c - c;
- else
- z = z*c + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 25:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- //z = z*sin(z.real()) + c*z*cos(z.imag()) + c;
- z = c*z*sin(z.real()) + c*z*cos(z.imag()) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 26:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) - z + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 27:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = z.ccos() + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 28:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn)*sin(z.real()) + c*z*cos(z.imaginary()) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 29:
- // Spider
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) + c;
- c = c/2 + z;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 30:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = ((z^5) + c) / ((z^3) + (z^2) + z + 1);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 31:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^9) - c*(z^6) + c*(z^3) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 32:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn)*sin(z.real()) +
- c*z.imaginary()*z +
- (z^rm)*cos(z.real()) +
- c*z*sin(z.imaginary()) + c;
-
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 33:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = c*(z.csin() + z.ccos()) * ((z^3) + z + c);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 34:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = z*z*(cmplx(expo,0)^z) - z*(cmplx(expo,0)^z) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 35:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = c*(z.csin() + z.ccos());
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 36:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn).cexp()/((z^rm)+c);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 37:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^12)*cos(z.real()) -
- (z^11)*sin(z.imaginary()) -
- (z^10)*tan(z.imaginary()) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 38:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^12) - (z^11) - (z^10) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 39:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) + c;
- z = z.csin();
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 40:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^rn) + c;
- z = z.cexp();
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 41:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = (z^pi) + (c^pi);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 42:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = ((((z^cn) + 1))^.5) + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 43:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = ((z^4) + c)^.5;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 44:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = cmplx(expo,0)^((z*c).ccos());
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 45:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = c*z - 1 + c*(cmplx(expo,expo))^(-z);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 46:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = 1/((z*z) + c);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 47:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = 2/(z*z + (c^rn));
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 48:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = z*z*(z*z).cexp() + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 49:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- //z = (z*z + c)^2 + c;
- z = (z*z+c)^(2+c);
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- case 50:
- for (i = 0; i < JMAX && z.squares() < dBailout ; i++)
- {
- z = z*z + (z*c).csin() + c;
- if (nFilter) Delta_z(z.real(), z.imaginary());
- }
- if (nFilter) Filter_Complete();
- break;
-
- default:
- AfxMessageBox("Real World Fractals, shouldn't get here...");
- break;
- }
- }
-
- void CIterationsView::OnViewOrbits()
- {
- bNewView = FALSE;
- bOrbits = TRUE;
- bDraw = TRUE;
- bLaunch = FALSE;
- if (!nFilter)
- nFilter = 28;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateViewOrbits(CCmdUI* pCmdUI)
- {
- if (CRMIN_NEW < CRMAX_NEW && CIMIN_NEW < CIMAX_NEW)
- pCmdUI->Enable(TRUE);
- else
- pCmdUI->Enable(FALSE);
- pCmdUI->SetCheck(bOrbits);
- }
-
- void CIterationsView::OnFractalsNofilter()
- {
- nFilter = 0;
- bFilter14 = FALSE;
- bFilter21 = FALSE;
- bFilter22 = FALSE;
- bFilter26 = FALSE;
- bFilter31 = FALSE;
- bFilter32 = FALSE;
- bFilter33 = FALSE;
- bFilter34 = FALSE;
- bFilter35 = FALSE;
- bFilter36 = FALSE;
- bFilter37 = FALSE;
- bFilter38 = FALSE;
- bMFilter = FALSE;
- bQuickMode = FALSE;
- bGeometry = FALSE;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractalsNofilter(CCmdUI* pCmdUI)
- {
- if (nFilter == 0)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals1filter()
- {
- nFilter=1;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals1filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 1)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals2filter()
- {
- nFilter=2;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals2filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 2)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals3filter()
- {
- nFilter=3;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals3filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 3)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals4filter()
- {
- nFilter=4;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals4filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 4)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals5filter()
- {
- nFilter=5;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals5filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 5)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFRACTALS6Filter()
- {
- nFilter=6;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFRACTALS6Filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 6)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals7filter()
- {
- nFilter = 7;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals7filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 7)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals8filter()
- {
- nFilter = 8;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals8filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 8) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals9filter()
- {
- nFilter = 9;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals9filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 9) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals10filter()
- {
- nFilter = 10;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals10filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 10) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractals11filter()
- {
- nFilter = 11;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFractals11filter(CCmdUI* pCmdUI)
- {
- if (nFilter == 11) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilters12filter()
- {
- if (!bFilter_12)
- {
- CFilter12 cf12;
- cf12.m_Power = dFilter_12Power;
- cf12.m_Magnif = dFilter_12Magnif;
- if (cf12.DoModal() == IDOK)
- {
- dFilter_12Power = cf12.m_Power;
- dFilter_12Magnif = cf12.m_Magnif;
- bFilter_12 = TRUE;;
- GoDoFractal();
- }
- }
- else
- {
- bFilter_12 = FALSE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateFilters12filter(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter_12);
- }
-
- void CIterationsView::OnFilter14()
- {
- if (bFilter14)
- {
- bFilter14 = FALSE;
- if (nFilter == 14)
- nFilter = 0;
- }
- else
- {
- bFilter14 = TRUE;
- bGeometry = TRUE;
- if (nFilter == 0)
- nFilter = 14;
- }
-
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter14(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter14);
- }
-
- void CIterationsView::OnFilter15()
- {
- nFilter = 15;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter15(CCmdUI* pCmdUI)
- {
- if (nFilter == 15) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter16()
- {
- nFilter = 16;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter16(CCmdUI* pCmdUI)
- {
- if (nFilter == 16) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter17()
- {
- nFilter = 17;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter17(CCmdUI* pCmdUI)
- {
- if (nFilter == 17) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter18()
- {
- nFilter = 18;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter18(CCmdUI* pCmdUI)
- {
- if (nFilter == 18) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter19()
- {
- nFilter = 19;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter19(CCmdUI* pCmdUI)
- {
- if (nFilter == 19) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter20()
- {
- nFilter = 20;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter20(CCmdUI* pCmdUI)
- {
- if (nFilter == 20) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter21double()
- {
- CRMIN = -4.0; // // left
- CIMIN = -4.0; // // top
- CRMAX = 4.0; // // right
- CIMAX = 4.0; // // bottom
-
- if (bFilter21)
- {
- bFilter21 = FALSE;
- if (nFilter == 21)
- nFilter = 0;
- }
- else
- {
- bFilter21 = TRUE;
- bGeometry = TRUE;
- if (nFilter == 0)
- nFilter = 21;
- }
-
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter21double(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter21);
- }
-
- void CIterationsView::OnFilter22quad()
- {
- CRMIN = -4.0; // // left
- CIMIN = -4.0; // // top
- CRMAX = 4.0; // // right
- CIMAX = 4.0; // // bottom
-
- if (bFilter22)
- {
- bFilter22 = FALSE;
- if (nFilter == 22)
- nFilter = 0;
- }
- else
- {
- bFilter22 = TRUE;
- bGeometry = TRUE;
- if (nFilter == 0)
- nFilter = 22;
- }
-
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter22quad(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter22);
- }
-
- void CIterationsView::OnFractalBiomorphnone()
- {
- dBiomorph = 0;
- bDraw = TRUE;
- bLaunch = FALSE;
- }
-
- void CIterationsView::OnFilter23sumof2ndderivative()
- {
- nFilter = 23;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter23sumof2ndderivative(CCmdUI* pCmdUI)
- {
- if (nFilter == 23) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter24()
- {
- CRW1 rw;
- rw.m_RW1_n = dF;
- if (rw.DoModal() == IDOK)
- {
- nFilter = 24;
- dF = rw.m_RW1_n;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateFilter24(CCmdUI* pCmdUI)
- {
- if (nFilter == 24) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter25()
- {
- CRW1 rw;
- rw.m_RW1_n = dF;
- if (rw.DoModal() == IDOK)
- {
- nFilter = 25;
- dF = rw.m_RW1_n;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateFilter25(CCmdUI* pCmdUI)
- {
- if (nFilter == 25) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter26()
- {
- if (!bFilter26)
- {
- CNthOrder real_order;
- real_order.m_RealNthOrder = rorder_r;
- real_order.m_ImaginaryNthOrder = rorder_i;
- if (real_order.DoModal() == IDOK)
- {
- rorder_r = real_order.m_RealNthOrder;
- rorder_i = real_order.m_ImaginaryNthOrder;
- bFilter26 = TRUE;
- cFilter26 = cmplx(rorder_r, rorder_i);
- if (!nFilter)
- nFilter = 26;
- bGeometry = TRUE;
- GoDoFractal();
- }
- else
- return;
- }
- else
- {
- bFilter26 = FALSE;
- if (nFilter == 26)
- nFilter = 0;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateFilter26(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter26 && nFilter);
- }
-
-
- void CIterationsView::OnFractalMfilter()
- {
- // Monster Filter
- if (bMFilter)
- {
- bMFilter = FALSE;
- if (nFilter == 27)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- // Create X and Y Temp Arrays for Multi-Fractals
- bMFilter = TRUE;
- if (!nFilter)
- nFilter = 27;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateFractalMfilter(CCmdUI* pCmdUI)
- {
- if (bMFilter && nFilter != 29) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter28()
- {
- // Quick mode checks delta z < 1e-4,
- // If true, assume iteration never escapes
- if (bQuickMode)
- {
- bQuickMode = FALSE;
- if (nFilter == 28)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- CRW1 rw;
- rw.m_RW1_n = dF28;
- if (rw.DoModal() == IDOK)
- {
- bQuickMode = TRUE;
- if (!nFilter)
- nFilter = 28;
- dF28 = rw.m_RW1_n;
- GoDoFractal();
- }
- }
- }
-
- void CIterationsView::OnUpdateFilter28(CCmdUI* pCmdUI)
- {
- if (bQuickMode) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter29()
- {
- // Turn off Fractal Dimension calculation (if it is on)
- nFDOption = 0;
- if (nFilter == 29)
- {
- bMFilter = FALSE;
- nFilter = 0;
- }
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter29(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 0)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter30()
- {
- nFilter = 130;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter30(CCmdUI* pCmdUI)
- {
- if (nFilter == 130) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter31()
- {
- nFilter = 131;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter31(CCmdUI* pCmdUI)
- {
- if (nFilter == 131) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter32()
- {
- nFilter = 132;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter32(CCmdUI* pCmdUI)
- {
- if (nFilter == 132) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter33()
- {
- nFilter = 133;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter33(CCmdUI* pCmdUI)
- {
- if (nFilter == 133) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter34()
- {
- nFilter = 134;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter34(CCmdUI* pCmdUI)
- {
- if (nFilter == 134) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter35()
- {
- nFilter = 135;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter35(CCmdUI* pCmdUI)
- {
- if (nFilter == 135) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter36()
- {
- nFilter = 136;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter36(CCmdUI* pCmdUI)
- {
- if (nFilter == 136) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter37()
- {
- nFilter = 137;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter37(CCmdUI* pCmdUI)
- {
- if (nFilter == 137) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter38()
- {
- nFilter = 138;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter38(CCmdUI* pCmdUI)
- {
- if (nFilter == 138) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter39()
- {
- nFilter = 139;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter39(CCmdUI* pCmdUI)
- {
- if (nFilter == 139) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter40()
- {
- nFilter = 140;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter40(CCmdUI* pCmdUI)
- {
- if (nFilter == 140) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter41()
- {
- nFilter = 141;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter41(CCmdUI* pCmdUI)
- {
- if (nFilter == 141) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter42()
- {
- nFilter = 142;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter42(CCmdUI* pCmdUI)
- {
- if (nFilter == 142) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter43()
- {
- nFilter = 143;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter43(CCmdUI* pCmdUI)
- {
- if (nFilter == 143) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter244()
- {
- nFilter = 144;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter244(CCmdUI* pCmdUI)
- {
- if (nFilter == 144) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter245()
- {
- nFilter = 145;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter245(CCmdUI* pCmdUI)
- {
- if (nFilter == 145) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter46()
- {
- nFilter = 146;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter46(CCmdUI* pCmdUI)
- {
- if (nFilter == 146) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFilter47()
- {
- nFilter = 147;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateFilter47(CCmdUI* pCmdUI)
- {
- if (nFilter == 147) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- ///////////////////////////////////////////////////////////
- void CIterationsView::OnOptions30()
- {
- nFilter = 30;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions30(CCmdUI* pCmdUI)
- {
- if (nFilter == 30) pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions31()
- {
- if (bFilter31)
- {
- bFilter31 = FALSE;
- if (nFilter == 31)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter31 = TRUE;
- if (!nFilter)
- nFilter = 31;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions31(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter31);
- }
-
- void CIterationsView::OnOptions32()
- {
- if (bFilter32)
- {
- bFilter32 = FALSE;
- if (nFilter == 32)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter32 = TRUE;
- if (!nFilter)
- nFilter = 32;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions32(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter32);
- }
-
- void CIterationsView::OnOptions33()
- {
- if (bFilter33)
- {
- bFilter33 = FALSE;
- if (nFilter == 33)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter33 = TRUE;
- if (!nFilter)
- nFilter = 33;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions33(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter33);
- }
-
- void CIterationsView::OnOptions34()
- {
- if (bFilter34)
- {
- bFilter34 = FALSE;
- if (nFilter == 34)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter34 = TRUE;
- if (!nFilter)
- nFilter = 34;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions34(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter34);
- }
-
- void CIterationsView::OnOptions35()
- {
- if (bFilter35)
- {
- bFilter35 = FALSE;
- if (nFilter == 35)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter35 = TRUE;
- if (!nFilter)
- nFilter = 35;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions35(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter35);
- }
-
- void CIterationsView::OnOptions36()
- {
- if (bFilter36)
- {
- bFilter36 = FALSE;
- if (nFilter == 36)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter36 = TRUE;
- if (!nFilter)
- nFilter = 36;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions36(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter36);
- }
-
- void CIterationsView::OnOptions37()
- {
- if (bFilter37)
- {
- bFilter37 = FALSE;
- if (nFilter == 37)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter37 = TRUE;
- if (!nFilter)
- nFilter = 37;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions37(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter37 && nFilter);
- }
-
- void CIterationsView::OnOptions38()
- {
- if (bFilter38)
- {
- bFilter38 = FALSE;
- if (nFilter == 38)
- nFilter = 0;
-
- GoDoFractal();
- }
- else
- {
- bFilter38 = TRUE;
- if (!nFilter)
- nFilter = 38;
- bGeometry = TRUE;
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptions38(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bFilter38 && nFilter);
- }
-
- ////////////////////////////////////////////////////////
- // Fractal Dimension Options
- ////////////////////////////////////////////////////////
-
- void CIterationsView::OnOptions1()
- {
- // Fractal Dimension
- nFDOption = 1;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions1(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 1)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions2()
- {
- // Fractal Dimension
- nFDOption = 2;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions2(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 2)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions3()
- {
- // Fractal Dimension
- nFDOption = 3;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions3(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 3)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions4()
- {
- // Fractal Dimension
- nFDOption = 4;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions4(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 4)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions5()
- {
- // Fractal Dimension
- nFDOption = 5;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions5(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 5)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions6()
- {
- // Fractal Dimension
- nFDOption = 6;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions6(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 6)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
-
- void CIterationsView::OnOptions7()
- {
- // Fractal Dimension
- nFDOption = 7;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions7(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 7)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions8()
- {
- // Fractal Dimension
- nFDOption = 8;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions8(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 8)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions9()
- {
- // Fractal Dimension
- nFDOption = 9;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions9(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 9)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnOptions10()
- {
- // Fractal Dimension
- nFDOption = 10;
- bMFilter = TRUE;
- nFilter = 29;
- GoDoFractal();
- }
-
- void CIterationsView::OnUpdateOptions10(CCmdUI* pCmdUI)
- {
- if (nFilter == 29 && bMFilter && nFDOption == 10)
- pCmdUI->SetCheck(TRUE);
- else pCmdUI->SetCheck(FALSE);
- }
-
- /////////////////////////////////////////////////////////////////////////
- // Biomorphs
- /////////////////////////////////////////////////////////////////////////
-
- void CIterationsView::OnUpdateFractalBiomorphnone(CCmdUI* pCmdUI)
- {
- if (dBiomorph == 0)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractal1biomorphxory()
- {
- dBiomorph = 1;
- bDraw = TRUE;
- bLaunch = FALSE;
- }
-
- void CIterationsView::OnUpdateFractal1biomorphxory(CCmdUI* pCmdUI)
- {
- if (dBiomorph == 1)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractalBiomorph()
- {
- dBiomorph = 2;
- bDraw = TRUE;
- bLaunch = FALSE;
- }
-
- void CIterationsView::OnUpdateFractalBiomorph(CCmdUI* pCmdUI)
- {
- if (dBiomorph == 2)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::OnFractalBiomorphtestxory()
- {
- dBiomorph = 3;
- bDraw = TRUE;
- bLaunch = FALSE;
- }
-
- void CIterationsView::OnUpdateFractalBiomorphtestxory(CCmdUI* pCmdUI)
- {
- if (dBiomorph == 3)
- pCmdUI->SetCheck(TRUE);
- else
- pCmdUI->SetCheck(FALSE);
- }
-
- void CIterationsView::PostProcess()
- {
- i_Post = i;
-
- bPostFractal = TRUE;
- nDistortion_save = nDistortion;
- nDistortion = nPostFractal;
- bPostProcess = FALSE;
- cOrient_save = cOrient;
- cOrient = cPostOrient;
-
- TestPatternSub();
-
- cOrient = cOrient_save;
- bPostProcess = TRUE;
- bPostFractal = FALSE;
- nDistortion = nDistortion_save;
-
- //if (i < i_Post) // Maximum
- // i = i_Post;
-
- i += i_Post;
- if (i >= NMAX) i %= (JMAX);
- }
-
- void CIterationsView::OnOptionsPostfractal()
- {
- if (bPostProcess)
- {
- bPostProcess = FALSE;
- GoDoFractal();
- }
- else
- {
- CPost post;
- post.m_Post = nPostFractal;
- if (post.DoModal() == IDOK)
- {
- nPostFractal = post.m_Post;
- bPostProcess = TRUE;
-
- COrient co;
- co.m_Real = cPostOrient.real();
- co.m_Imag = cPostOrient.imag();
- if (co.DoModal() == IDOK)
- {
- cPostOrient.set_real(co.m_Real);
- cPostOrient.set_imag(co.m_Imag);
- }
- GoDoFractal();
- }
- }
- }
-
- void CIterationsView::OnUpdateOptionsPostfractal(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bPostProcess);
- }
-
- void CIterationsView::PreCombo()
- {
- nDistortion_save = nDistortion;
- nDistortion = nPostFractal;
- bPostFractal = TRUE;
-
- TestEquations();
-
- bPostFractal = FALSE;
- nDistortion = nDistortion_save;
- }
-
- void CIterationsView::OnOptionsCombo()
- {
- CPost post;
- post.m_Post = nPostFractal;
- if (post.DoModal() == IDOK)
- {
- nPostFractal = post.m_Post;
- bCombo = TRUE;
- if (nPreFractal == 0)
- nPreFractal = 1;
-
- GoDoFractal();
- }
- }
-
- void CIterationsView::OnUpdateOptionsCombo(CCmdUI* pCmdUI)
- {
- pCmdUI->SetCheck(bCombo);
- }
-